import request from '~/utils/resquest'

// 岗位管理 主列表
export const getSystemPostList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-system/post/listPage', method: 'GET', params })
}

// 所属租户
export const getTenantSelect = () => {
  return request({ url: '/api/gxsaas-system/tenant/select', method: 'GET' })
}

// 新增岗位
export const postSystemPostAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-system/post/add', method: 'POST', data })
}

// 编辑岗位
export const postSystemPostUpdate = <T>(data: T) => {
  return request({ url: '/api/gxsaas-system/post/update', method: 'POST', data })
}

// 删除岗位
export const postSystemPostRemove = <T>(data: T) => {
  return request({ url: `/api/gxsaas-system/post/remove?ids=${data}`, method: 'POST' })
}

// 根据部门id获取岗位下拉列表
export const getPostSelectListByDeptId = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/deptPost/selectByDeptId',
    method: 'get',
    params
  })
